<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Tymon\JWTAuth\Contracts\JWTSubject;
use Laravel\Sanctum\HasApiTokens;
use Illuminate\Notifications\Notifiable;



class Merchant extends Authenticatable implements JWTSubject
{
    use HasApiTokens,
        Notifiable,
        HasFactory;

     use Notifiable {notify as laravelNotify;}

    protected $guarded = ['id'];

    public function getJWTIdentifier()
    {
        return $this->getKey();
    }

    public function getJWTCustomClaims()
    {
        return [];
    }

    public function couponRecords()
    {
        return $this->hasMany(CouponRecord::class, 'merchant_id', 'id');
    }
    public function floor()
    {
        return $this->belongsTo(Floor::class, 'floor_id', 'id');
    }

    public function merchantCategory()
    {
        return $this->belongsTo(MerchantCategory::class, 'merchant_category_id', 'id');
    }
}
